package com.zy.ivideo.controller;

import com.zy.ivideo.entity.ResponseEntity;
import com.zy.ivideo.entity.unionentity.IUnionVideoSimpleEntity;
import com.zy.ivideo.service.VideoSimpleService;
import com.zy.ivideo.token.PassToken;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/videosimple")
@Api(value = "Simple视频模块API接口", description = "该模块提供Simple视频模块服务", tags = "Simple视频模块")
public class VideoSimpleController {
    @Autowired
    VideoSimpleService service;

    /**
     * 根据ChannelId获取对应Simple视频信息
     * @param channelId
     * @param page
     * @param pagesize
     * @return
     */
    @PassToken
    @ApiOperation(value = "根据ChannelId获取对应Simple视频信息", notes = "根据ChannelId获取对应Simple视频信息", httpMethod = "GET")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(dataType = "String", name = "channelId", value = "ChannelId", required = true),
            @ApiImplicitParam(dataType = "int", name = "page", value = "当前页数", required = true),
            @ApiImplicitParam(dataType = "int", name = "pagesize", value = "每页数据数", required = true),
    })
    @GetMapping("/getSimpleVideoByChannelId")
    public ResponseEntity<List<IUnionVideoSimpleEntity>> getSimpleVideoByChannelId(String channelId, int page, int pagesize){
        return service.getSimpleVideoByChannelId(channelId,page,pagesize);
    }

    /**
     * 获取推荐Simple视频信息
     * @param page
     * @param pagesize
     * @return
     */
    @PassToken
    @ApiOperation(value = "获取推荐Simple视频信息", notes = "获取推荐Simple视频信息", httpMethod = "GET")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(dataType = "int", name = "page", value = "当前页数", required = true),
            @ApiImplicitParam(dataType = "int", name = "pagesize", value = "每页数据数", required = true),
    })
    @GetMapping("/getRecommendSimpleVideo")
    public ResponseEntity<List<IUnionVideoSimpleEntity>> getRecommendSimpleVideo(int page,int pagesize){
        return service.getRecommendSimpleVideo(page,pagesize);
    }
}
